package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_IndexModule 首页模块
 *
 */
public class TestData_TB_IndexModule
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModule saveMust(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModule");
		return (TB_IndexModule)repository.save(newMust(
				
			));
	}
	
	public static TB_IndexModule newMust(
		
	){
		return new TB_IndexModule(new TB_IndexModule.MustProperties() {
			/** 类型 */
			@Override public bairui.international.model.type.Type_IndexModule getType(){
				return bairui.international.model.type.Type_IndexModule.Product;
			}
			/** 名称 */
			@Override public String getName(){
				return Generator.generate(0, 50);
			}
			/** 状态 */
			@Override public com.sh_lianjing.model.status.State_UpDown getState(){
				return com.sh_lianjing.model.status.State_UpDown.Downed;
			}
			/** 置顶标志 */
			@Override public Boolean getTopFlag(){
				return new java.util.Random().nextBoolean();
			}
			/** 分页标志 */
			@Override public Boolean getPageFlag(){
				return new java.util.Random().nextBoolean();
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModule saveAll(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModule");
		return (TB_IndexModule)repository.save(newAll(
				
			));
	}
	
	public static TB_IndexModule newAll(
		
	){
		return new TB_IndexModule(
			new TB_IndexModule.MustProperties() {
				/** 类型 */
				@Override public bairui.international.model.type.Type_IndexModule getType(){
					return bairui.international.model.type.Type_IndexModule.Product;
				}
				/** 名称 */
				@Override public String getName(){
					return Generator.generate(0, 50);
				}
				/** 状态 */
				@Override public com.sh_lianjing.model.status.State_UpDown getState(){
					return com.sh_lianjing.model.status.State_UpDown.Downed;
				}
				/** 置顶标志 */
				@Override public Boolean getTopFlag(){
					return new java.util.Random().nextBoolean();
				}
				/** 分页标志 */
				@Override public Boolean getPageFlag(){
					return new java.util.Random().nextBoolean();
				}
			},
			new TB_IndexModule.OptionalSingleProperties() {
				/** 说明 */
				@Override public String getComment(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
